In-band management interface with user space datapath

ABSTRACT

A method of utilizing the same hardware network interface card (NIC) in a gateway of a datacenter to communicate datacenter tenant packet traffic and packet traffic for a set of applications that execute in the user space of the gateway and utilize a network stack in the kernel space of the gateway. The method sends and receives packets for the datacenter tenant packet traffic through a packet datapath in the user space. The method sends incoming packets from the NIC to the set of applications through the datapath in the user space, a user-kernel transport driver connecting the kernel network stack to the datapath in the user space, and the kernel network stack. The method receives outgoing packets at the NIC from the set of applications through the kernel network stack, the user-kernel transport driver, and the data path in the user space.

BACKGROUND

Traditional network packet processing requires packets to traversekernel space and then to user space applications. Due to overhead inkernel space such as system calls and TCP/IP stack, a high performanceuser space I/O pipeline can be utilized where a network interface card(NIC) directly receives and transmits packets to/from user space withoutrequiring the packets to traverse the kernel space.

One limitation of such a user space I/O pipeline is that the user spaceowns the NIC. For management applications that rely on TCP/IP stack, aseparate dedicated NIC has to be assigned for sending and receiving thepackets that has to go through the TCP/IP stack in the kernel space.This requirement adds cost due to additional NIC hardware, additionalswitch ports, and the complexity of managing the additional hardware.

BRIEF SUMMARY

Some embodiments provide an in-band management interface, wheremanagement traffic and user space network I/O share the same networkinterface card (NIC). Different embodiments provide different solutionsto support the in-band management interface. Some embodiments providethe in-band management interface by using a user-kernel transportdriver. Other embodiments use SR-IOV to provide NIC bifurcation

Some embodiments provide a method of utilizing the same hardware networkinterface card (NIC) in a gateway to communicate datacenter tenantpacket traffic and packet traffic for a set of applications that executein the user space of the gateway. The set of applications utilize anetwork, stack such as the TCP/IP stack, in the kernel space of thegateway to communicate packets. The method sends and receives packetsfor the datacenter tenant packet traffic through a packet datapath inthe user space of the gateway.

The method sends the incoming packets from the NIC to the set ofapplications through a pipeline that includes a datapath in the userspace, a user-kernel transport driver that connects the kernel networkstack to the datapath in the user space, and the kernel network stack.The method receives outgoing packets at the NIC from the set ofapplications through the kernel network stack, the user-kernel transportdriver, and the datapath in the user space. The user-kernel transportdriver in some embodiments is kernel NIC interface (KNI).

Some embodiments provide a method of communicating packet traffic by anSR-IOV enabled NIC of a gateway. The SR-IOV provides a physical function(PF) and a set of virtual functions (VFs) for the NIC. The method at thePF of the NIC, communicates packets for a set of tenants of thedatacenter through a packet datapath in the user space of the gateway.The method at one of the VFs of the NIC, communicates packets betweenthe NIC and a set of applications that execute in the user space of thegateway through the VF, a kernel VF driver, and a kernel network stackin a kernel space of the gateway.

The preceding Summary is intended to serve as a brief introduction tosome embodiments of the invention. It is not meant to be an introductionor overview of all inventive subject matter disclosed in this document.The Detailed Description that follows and the Drawings that are referredto in the Detailed Description will further describe the embodimentsdescribed in the Summary as well as other embodiments. Accordingly, tounderstand all the embodiments described by this document, a full reviewof the Summary, Detailed Description and the Drawings is needed.Moreover, the claimed subject matters are not to be limited by theillustrative details in the Summary, Detailed Description and theDrawing, but rather are to be defined by the appended claims, becausethe claimed subject matters can be embodied in other specific formswithout departing from the spirit of the subject matters.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features of the invention are set forth in the appendedclaims. However, for purpose of explanation, several embodiments of theinvention are set forth in the following figures.

FIG. 1 illustrates a packet processing pipeline for a gateway accordingto prior art.

FIG. 2 illustrates a user space packet processing pipeline for a gatewayaccording to prior art.

FIG. 3 conceptually illustrates a data center whose traffic to and froman external network goes through a set of gateways.

FIG. 4 conceptually illustrates a user space packet processing pipelinethat shares the same NIC between the management traffic and user spaceDPDK aware traffic in some embodiments.

FIG. 5 conceptually illustrates a process for setting up a datapathpipeline to allow the use of the same NIC for the datapath daemon andthe user space applications that require the user of the kernel networkstack.

FIG. 6 conceptually illustrates a process for processing incomingpackets by the pipeline of FIG. 4 in some embodiments.

FIG. 7 conceptually illustrates a process for processing outgoingpackets by the pipeline of FIG. 4 in some embodiments.

FIG. 8 conceptually illustrates an example of the datapath daemoncomponents for in-band management interface in some embodiments.

FIG. 9 conceptually illustrates a process for restoring the managementinterface network connectivity when the datapath daemon fails in someembodiments.

FIG. 10 conceptually illustrates a user space packet processing pipelinethat uses bifurcation to share the same NIC between the managementtraffic and user space DPDK aware traffic in some embodiments.

FIG. 11 conceptually illustrates a process for using flow bifurcation toconfigure a datapath pipeline to allow the use of the same NIC for thedatapath daemon and the user space applications that require the user ofthe kernel network stack.

FIG. 12 conceptually illustrates a process for processing packets by thepipeline of FIG. 10 in some embodiments.

FIG. 13 conceptually illustrates a process for restoring the managementinterface network connectivity when the datapath daemon fails in someembodiments.

FIG. 14 conceptually illustrates an electronic system with which someembodiments of the invention are implemented.

DETAILED DESCRIPTION

Traditional network packet processing requires packets to traversekernel space to/from a user space application. FIG. 1 illustrates apacket processing pipeline for a gateway according to prior art. Someoperating systems, such as Linux, divide memory space into user spaceand kernel space. The kernel space is reserved for running a privilegedoperating system kernel, kernel extensions, and most device drivers. Incontrast, user space is a memory area where application software andsome device drivers execute.

As shown, the memory space of the gateway 100 is divided into user space110 and kernel space 115. The gateway also includes a network interfacecard (NIC) 150. The NIC 150 is a hardware (or physical) NIC (PNIC). TheNIC 150 includes hardware circuitry that connects that gateway 100 to anetwork 170. In order to send and receive packets from the networkinterface card (NIC) 150, a user space application 140 in the user space110 binds to a socket 120 (e.g., a transport control protocol/Internetprotocol (TCP/IP) socket) in the kernel space 115.

The NIC driver 125 maintains a set of input/output (I/O) buffers 130such as first in, first out (FIFO) ring buffers that point to datastructures in kernel that hold packet data. The NIC driver 125sends/receives packets to/from the NIC 150. The NIC has a set ofhardware buffers 160 to store packets and communicates the packets withthe network 170. As shown, the NIC 150 indirectly sends and receivespackets to/from the user space application 140 through the kernel space115.

Due to overhead in kernel space such as system calls (e.g., for userspace to kernel space memory conversion), TCP/IP stack, etc., Linux anddata plane development kit (DPDK) community advocated user space I/O forattaining high performance, where the NIC directly receives andtransmits packets to/from the user space.

FIG. 2 illustrates a user space packet processing pipeline for a gatewayaccording to prior art. DPDK 220 is a set of libraries and drivers thatprovide a framework for development of packet networking applications inuser space 110. Datapath daemon 225 provides services such as routing,switching, virtual private network (VPN), etc. For instance, thedatapath daemon 225 provides networking layer (Open SystemsInterconnection (OSI) 13 (layer 3)) forwarding and services in logicalnetworks.

As shown, the I/O buffers 215 (e.g., ring buffers) are in the user space110 and point to data structures in the user space that hold packetdata. The I/O driver kernel module 210 provides resource mapping fromthe kernel space to the user space. The I/O driver kernel module 210provides direct memory access (DMA) into the user space 110 and allowsthe NIC 150 to be managed from the user space 110, bypassing the kernelspace 115. Packet data is transferred from the user space 110 to the NIC150 without going through the kernel space 115.

One limitation of the user space I/O is that the datapath daemon 225completely owns the NIC device 150. There are, however, user spaceapplications that are not DPDK aware. For instance, the applications inthe management interface that are used to manage guest virtual machines(VMs) on a host in a data center are not DPDK aware. A VM is a softwareimplementation of a machine such as a computer. The management interfaceprovides applications and services to monitor the state of VMs and thehost on which the VMs are running, control (e.g., power on, suspend,resume, reset, and power off) the VMs on a host, connect anadministrator console to a VM for the VM management, view details abouteach VM (e.g., system summary, hardware information, connected users, alog of recent events), secure console and management interface sessions,etc.

Examples of these applications include user space secure shell (ssh),dynamic host configuration protocol (DHCP) client, user space managementplane agent communicating with the management plane, control plane agentcommunicating with the control plane, etc. These user space applicationsrely on TCP/IP stack in kernel space for packet communication.

For the user space applications that are not DPDK aware, a separatededicated NIC has to be assigned. If link redundancy is required, aminimum of two additional NICs is needed to create link aggregation bondfor management traffic. The use of the additional NICs adds cost due toadditional NIC hardware and switch ports, and creates complexitymanaging them. This model is referred to herein as out-band managementtraffic and is for user space applications that are not DPDK aware.

Some embodiments provide an in-band management interface for user spaceapplications that are not DPDK aware. In these embodiments, managementtraffic and user space network I/O share the same NICs. FIG. 3conceptually illustrates a data center 300 whose traffic to and from anexternal network 390 goes through gateways 311-312. Each of the gatewaysoperates a user space datapath pipeline (341 and 342 respectively) forprocessing packets that go through the gateway. Each user space datapathpipeline 341-342 includes an in-band management interface (351 and 352respectively), which allows DPDK aware user space applications and userspace applications that are not DPDK aware to share the same NIC throughthe corresponding user space datapath pipelines 341-342.

The datacenter 300 includes other computing and networking resources321-329 that are interlinked by a provider network. These resourcescommunicate with each other through a provider network and with theexternal network 390 by network traffic over physical communicationmediums (which can include wired communications such as Ethernet orwireless communications such as WiFi). Packets from the computing andnetworking resources 321-329 can reach the external network 390 throughone of the gateways 311-312, and packets from the external network 390can reach the computing and network resources 321-329 through one of thegateways 311-312. A gateway of a network is therefore regarded as beingat the edge of the network and therefore also referred to as an edgedevice or edge node.

In some embodiments, some of these resources are provided by computingdevices serving as host machines 321-329. Some of these host machinesoperate virtualization software, which allow these host machines to hostvarious virtual machines (VMs). In some embodiments, a gateway is itselfa host machine, and user space datapath pipelines (341 or 342) of thegateway is provided by one of the VMs running on its virtualizationsoftware. Some of these resources are running as “bare metal”, i.e.,without virtualization software. In some embodiments, the gateway is abare metal computing device that operates its datapath pipeline directlyover its own operating system without virtualization software.

In some embodiments, the packet traffic within the datacenter isconducted by using overlay logical networks such as Virtual eXtensibleLAN (VXLAN), Generic Network Virtualization Encapsulation (GENEVE), andNetwork Virtualization using Generic Routing Encapsulation (NVGRE). Insome of these embodiments, each of the host machines and the gatewaymachines is a VXLAN endpoint (referred to as VTEP) that transmitspackets using overlay encapsulation. In some embodiments, the externalphysical network is conducted by VLAN, and the gateways relay thetraffic between the datacenter and the external network by translatingVXLAN packets to VLAN packets and vice versa.

In some embodiments, the computing and networking resources of thedatacenter implement one or more logical networks, each logical networkhaving access to the gateways 311-312 for traffic to and from theexternal network 390. In some embodiments, each logical network has itsown set of logical routers and logical switches for conducting networktraffic of the logical network. Some or all of these logical routers andswitches are provided by software operating in the host machines (eitheras virtualization software or as programs executing on bare metal hostmachines). In some embodiments, some of the logical routers and switchesoperate in the gateways 311-312 as stages in their respective datapathpipelines 341-342.

In some embodiments, the datacenter 300 includes a network manager 380for provisioning or creating the logical networks in the data center 300and a network controller 370 (or a cluster of controller) forcontrolling the various logical routers and switches (including thoseoperating in the gateways 311-312) of the various logical networks.

The control plane of some embodiments configures and manages one or morelogical networks for one or more tenants of a hosting system (e.g., adatacenter). In some embodiments, a logical network of the hostingsystem logically connects a set of end machines (e.g., virtual machines,physical servers, containers, etc.) to a set of physical machines usinga set of logical forwarding elements (e.g., logical layer 2 (L2) and L3switches). In some embodiments, different subsets of end machines resideon different host machines that execute managed forwarding elements(MFEs). The MFEs implement the logical forwarding elements of thelogical network to which the local end machines are logically connected.These MFEs may be flow-based forwarding elements (e.g., Open vSwitch),code-based forwarding elements, or a combination of the two, in variousdifferent embodiments. These different types of forwarding elementsimplement the various logical forwarding elements differently, but ineach case they execute a pipeline for each logical forwarding elementthat may be required to process a packet.

In the virtualization field, some refer to software switches as virtualswitches as these are software elements. However, in this specification,the software forwarding elements are referred to as MFEs, in order todistinguish them from logical forwarding elements (LFEs), which arelogical constructs that are not tied to the physical world. An MFEforwards packets in a physical network whether or not it is implementedin software while an LFE forwards packets in a logical network, which islogically decoupled or abstracted from the physical network. In otherwords, the software forwarding elements exist and operate in thephysical world, whereas an LFE is a logical representation of aforwarding element that is presented to a user when designing a logicalnetwork.

Some embodiments provide support for in-band interface for applicationsthat are not DPDK aware. In these embodiments, traffic that uses thenetwork stack in the kernel and the user space network traffic share thesame NICs. In some embodiments, the in-band traffic interface isprovided by utilizing user space kernel transport. In other embodiments,the interface is provided by utilizing flow bifurcation to split trafficbetween the user space and kernel space.

I. In-Band Management Interface Using User Space Kernel Transport

Some embodiments provide in-band management interface by utilizing auser-kernel data transport mechanism such as KNI (Kernel NIC Interface).KNI allows user space application access to the kernel space. KNI alsoprovides an interface with the kernel network stack. FIG. 4 conceptuallyillustrates a user space packet processing pipeline that shares the sameNIC between management traffic and user space DPDK aware traffic in someembodiments. As shown, the user space 110 includes a datapath pipelinethat includes the datapath daemon 225, DPDK 220 libraries and drivers,and I/O buffers 215.

The gateway 400 in some embodiments sends and receives packets for alogical network that includes a set of logical entities that make a datapath for forwarding the packets to their destinations. DPDK 220 is a setof libraries and drivers that provide a framework for development ofpacket networking applications in user space 110. Datapath daemon 225provides services such as routing, switching, VPN, etc.

The user space 110 also includes applications 405-420 that are not DPDKaware and cannot directly use the datapath pipeline to send and receivepackets to/from the network through the NIC 150. As shown, applications405-420 require the use of a kernel network stack 425 (such as TCP/IPstack) to send and receive packets.

Examples of these applications include user space ssh 405 used toremotely log into a user space application, DHCP client 415 used toprovide an IP host with its IP address and other configurationinformation such as the subnet mask and default gateway, and user spacemanagement plane agent 410 used to communicate with the managementplane.

Other DPDK unaware applications 420 include control plane agent used tocommunicate with the control plane servers, applications and servicesthat monitor the state of VMs and the hosts, applications that control(e.g., power on, suspend, resume, reset, and power off) the VMs on ahost, applications for connecting an administrator console to a VM,applications that provide information regarding each VM (e.g., systemsummary, hardware information, connected users, a log of recent events),secure console and management interface sessions, etc. These user spaceapplications rely on TCP/IP stack in kernel space for packetcommunication.

In some embodiments, the operating system of the gateway machineprovides the kernel network protocol stack 425 as a processing thread inits kernel space. Such a network stack is normally used to handlenetwork protocols for packets at the NIC 150 of the gateway machine 400.

As shown, the user space applications 405-420 use kernel network stack425 for communicating packets, and ending and receiving packets throughthe kernel network stack 425 (e.g., the TCP/IP stack in the kernel space115). The gateway 400 includes a user to kernel transport driver 430(such as KNI) for the management interface. The KNI allows user spaceapplications such as datapath daemon 225 to access kernel spaceapplications such as the kernel network stack 425. The configuration ofthe gateway 400 allows the management interface applications 405-420that use the kernel network stack 425 in the kernel space 115 to sharethe same NIC 150 (or the same set of NICs) with the tenant traffic ofthe datacenter that directly goes through the datapath daemon 225without going through the kernel space. It should be understood thatdevice 300 is a gateway that sends and receives datacenter tenant packettraffic from a set of tenant VMs on a set of hosts that are external tothe gateway while the management interface applications 405-420 areapplications in the user space of the gateway.

FIG. 5 conceptually illustrates a process 500 for setting up a datapathpipeline to allow the use of the same NIC for the datapath daemon andthe user space applications that require the user of the kernel networkstack. The process in some embodiments is performed by the gateway 400in FIG. 4.

As shown, the process receives (at 505) an IP address and a networkidentification for configuring a network for the management interface.The process in some embodiments, receives the IP address and the networkidentification from a user (e.g., during the first boot after thedatapath daemon installation) through a user interface such as thecommand line interface (CLI) or a graphical user interface.

The process in some embodiments receives a static IP address (or an IPaddress from a range of IP addresses using DHCP) and an identificationof a network for the management interface. For instance, the processreceives a static IP address of 10.10.10.5/24 and a virtual local areanetwork (VLAN) of 10 for the management interface. The classlessinter-domain routing (CIDR) notation 10.10.10.5/24 indicates that 24bits of the IP address are allocated for the subnet and the remaining 8bits are used to identify an individual interface on the subnet. Itshould be understood that instead of a VLAN another type of network(e.g., an overlay network) could be used for the management interface.

The process then assigns (at 510) all NICs (such as NIC 150 or any otherNICs used by the gateway 400 in FIG. 4) to the user space. For instance,the process binds a DPDK driver in the user space to the NIC 150 in FIG.4. The process instantiates (at 515) a user space managed forwardingelement (MFE) for the management interface VLAN. For instance, thedatapath daemon 225 in FIG. 4 uses library functions and drivers in theDPDK 220 to configure an MFE (or a logical switch) to connect themanagement interface VLAN.

The process also instantiates (at 515) a user space MFE for themanagement interface VLAN. The process also instantiates (at 520) akernel transport driver (such as KNI) to use FIFO based shared memory toreceive and transmit packets between user space and kernel space. Forinstance, the process instantiate user-kernel transport driver 430 inFIG. 4 and provides the user-kernel transport driver configuration(e.g., the IP address and MAC address of the KNI) to the datapath daemon225 to use in packet forwarding.

The process also instantiates (at 525) a virtual routing and forwarding(VRF) port for the management interface. The VRF allows multipleinstances of a routing table to co-exist within the same network deviceat the same time. Because the routing instances are independent, thesame or overlapping IP addresses can be used without conflicting witheach other. The process creates a port for the VRF and connects the portto the logical switch.

The process also instantiates (at 530) a management endpoint interfacein user the space to inherit the NIC's media access control (MAC)address and forward packets destined to this MAC address to the kerneltransport driver. For instance, the process instantiates an endpointinterface to inherit the MAC address of the NIC 150 in FIG. 4. It shouldbe understood that a VXLAN tunnel endpoint (VTEP) may also inherit theMAC address from the NIC but there shall not be MAC conflict as themanagement and overlay networks are in different LANs.

The process then creates (at 535) a network interface profile for thekernel transport driver and specifies the user defined static IP address(or DHCP based IP address) for the profile. For instance, the processcreates a network interface profile (e.g., in theLinux/etc/network/interfaces system file) for the KNI device andspecifies static address 10.10.10.5/24 for the profile. The profileensures that the KNI configuration is saved in the Linux system file andthe static IP information or the VLAN information is not lost after areboot. The process then ends.

FIG. 6 conceptually illustrates a process 600 for processing incomingpackets by the pipeline of FIG. 4 in some embodiments. The process insome embodiments is performed by the gateway 400 in FIG. 4. As shown,the process forwards (at 605) all incoming packet traffic from the NICto the datapath daemon in the user space. For instance, the processforwards the incoming packets that are received at the NIC 150 to thedatapath daemon 225 in FIG. 4.

The process then uses (at 610) the VLAN MFE and the endpoint interfacecreated in the user space, to forward all incoming packet traffic sentto the management interface VLAN and the NIC MAC address through thekernel transport driver to network stack in kernel. For instance, allincoming packet traffic received at the datapath daemon 225 that areaddressed to the management interface VLAN (VLAN 10 in the exampleabove) and the NIC MAC address are sent from the datapath daemon 225 tothe user-kernel transport driver 430 (e.g., the KNI) of the managementinterface.

The process then forwards (at 615) the packet traffic from theuser-kernel transport driver to the kernel network stack. For instance,the user-kernel transport driver 430 (e.g., the KNI) of the managementinterface (in the kernel space) sends the packets to the kernel networkstack 425 (e.g., the TCP/IP stack), which is also in the kernel space.

The process then dispatches (at 620) the packet traffic based ondestination IP of the packets from the kernel network stack to thedestination application in the management interface. For instance, thekernel network stack 425 forwards the packets to one of the managementinterface applications 405-420 based on the destination IP address ofthe packets. The process then proceeds to 605, which was described aboveto continue processing the incoming packets.

FIG. 7 conceptually illustrates a process 700 for processing outgoingpackets by the pipeline of FIG. 4 in some embodiments. The process insome embodiments is performed by the gateway 400 in FIG. 4. As shown,the process receives (at 705) outgoing packet traffic at the kernelnetwork stack from multiple management interface applications in theuser space. For instance, the kernel network stack 425 (such as theTCP/IP stack) in the kernel space 115 receives outgoing packets from themanagement interface applications 405-420 in the user space.

The process then sends (at 710) the packets from the network stack tothe user-kernel transport driver of the management interface. Forinstance, the process sends packets from the kernel network stack 425 tothe kernel transport driver 430 in FIG. 4. The process then forwards (at715) the packets from the user-kernel transport driver in the kernelspace to the datapath daemon in the user space. For instance, theprocess forwards the packets from the user-kernel transport driver 430to the datapath daemon 225.

The process then sends the packets from the datapath daemon to the NICthrough the pipeline in the user space. For instance, the process sendsthe packets from the datapath daemon 225 to the NIC 150 to send to thenetwork 170. The process then proceeds to 705, which was described aboveto continue processing the outgoing packets.

For the processes 600 and 700, routing and address resolution protocol(ARP) learning for the management interface is done in the datapathdaemon 225 in some embodiments. In other embodiments, routing and ARPlearning for the management interface is done in the gateway kernel.

FIG. 8 conceptually illustrates an example of the datapath daemoncomponents for in-band management interface in some embodiments. Asshown, the kernel space 115 includes several user-kernel transportdrivers (in this example KNIs) including a KNI 805 for uplink tohandling control plane packets (e.g., packets including routeinformation exchange under BGP or border gateway protocol) 820, the KNI430 for the management interface that handles packets to and from amanagement plane agent (MPA) 825 in the user space, and one or moreother KNIs 815 for handling packets for the local control plane (LCP).

The KNI for management interface 430 sends and receives packets to/fromdatapath daemon 225 as described above by reference to FIGS. 4-7. Asshown, the KNI for management interface 430 is connected to themanagement VFR 850 of the datapath daemon 225.

The datapath daemon 225 includes several MFEs (or logical switches)855-865, several VRFs 840 and 850, a PLR-SR 845, and a logical topology835. One of the MFEs (in this example logical switch for VLAN Z) is theMFE that was described by reference to operation 515 in FIG. 5. Thislogical switch is the MFE that is connected to VLAN 10 for themanagement interface in the example described above. Other components ofthe datapath daemon 225 are shown as the logical topology 835 forbrevity. Further details of the datapath daemon can be found in U.S.Patent Publication 2016/0226957, entitled “Edge Datapath UsingUser-Kernel Transports,” contents of which is hereby incorporated byreference.

As shown, multiple logical switches 855-860 share the NIC(s) withmanagement logical switch 865. One MFE (logical switch for VLAN X 855 inthis example) is used for a VTEP (vtep1 in this example) to connect to atunnel VRF 840. Another MFE (logical switch for VLAN Y 860 in thisexample) is used for the uplinks to connect to a point of local repairsegment routing (PLR-SR) VRF 845. An uplink is a module that relayspackets between an MFE (in this example logical switch for VLAN Y 860)and the NICs in order to perform various packet processing functions onincoming and outgoing traffic.

Management VRF 850, logical switch for VLAN Z 865, and KNI formanagement interface 430 in this example are the components that areadded to the datapath 225 to support the in-band management interfaceand are persisted by local host. They continue to exist after hostreboot.

Some embodiments support link aggregation for the management interface.As shown, the LAN Ethernet connections fp-eth0 875 and fp-eth1 880(e.g., the connections to two NICs) form a bond (in this example bond 0870), and the bond is connected to multiple logical switches 855-865. Inthis case, management interface inherits the MAC address of the bonddevice. The NIC configuration for other logical switches 855-860 isconsistent with management interface logical switch 865 (i.e. alllogical switches use bond, or all use individual NIC).

Datapath daemon 225 is implemented in the user space 110 and controlsthe packet pipeline to the NIC 150 in FIG. 4. If the datapath daemon 225crashes, due to the sharing of the NIC between management interfaceapplications 405-430 and the datapath daemon 225, the managementinterface applications 405-430 loses connectivity to the outside network170. The failure remediation in some embodiments is to automatically ormanually re-assign the NIC 150 to the kernel. As a result, themanagement interface no longer uses the datapath for networkconnectivity, and restore the connectivity of management interface usingthe kernel space as described by reference to FIG. 1. Once theconnection is restored through the kernel space, the logical switchconfiguration for the DPDK is removed. Afterwards, the user can remotelyconnect into the host (e.g., by using ssh 405) to troubleshoot theproblem.

FIG. 9 conceptually illustrates a process 900 for restoring themanagement interface network connectivity when the datapath daemon failsin some embodiments. The process is performed either manually orautomatically by a monitoring script that monitors the status of thedatapath daemon in some embodiments.

As shown, the process configures (at 905) the datapath daemon in theuser space. For instance, the process configures datapath daemon 225 asdescribed above by reference to FIGS. 4-8. The process then uses (at910) the datapath daemon (as described above) for sending and receivingpackets for the user space applications including the tenantapplications that use the datapath daemon directly (i.e. not goingthrough the kernel space) and the management interface applications405-420 that use kernel network stack 425 as described above byreference to FIGS. 4-8.

The process then determines (at 915) whether the datapath daemon hasfailed. For instance, the process determines whether the datapath daemon225 in FIG. 4 has crashed. If not, the process proceeds to 910 tocontinue using the datapath daemon for both tenant user spaceapplications and the management interface user space applications.

Otherwise, the process re-assigns (at 920) the NICs to the kernel. Forinstance, the process bonds the NIC 150 (or multiple NICs in a linkaggregation group) to a NIC driver (such as driver 125 in FIG. 1) in thekernel space. The process then restores (at 925) the managementinterface connectivity through the kernel. For instance, the processconnects management interface applications 405-420 to a kernel pipelinesuch as the pipeline shown in FIG. 1.

The process then removes (at 930) the MFE that was configured for themanagement interface. For instance, the process removes the logicalswitch for VLAN Z 865 in FIG. 8. The process then ends.

II. In-Band Management Interface Using Bifurcation

Some embodiments provide in-band management interface by utilizing flowbifurcation to split traffic between the user space and kernel space.FIG. 10 conceptually illustrates a user space packet processing pipelinethat uses bifurcation to share the same NIC between the managementtraffic and user space DPDK aware traffic in some embodiments.

As shown, the user space 110 includes the datapath pipeline thatincludes the datapath daemon 225, DPDK 220 libraries and drivers, andI/O buffers 215. The user space 110 also includes applications 405-420that are not DPDK aware and cannot directly use the datapath pipeline tosend and receive packets to/from the network through the NIC 150. Asshown, applications 405-420 require the use of a kernel network stack425 (such as TCP/IP stack) to send and receive packets. Examples ofthese applications where given above by reference to FIG. 4.

Peripheral Component Interconnect Express (PCIe) is a high-speed serialcomputer expansion bus standard. Single root input/output virtualization(SR-IOV) is a specification that allows a single PCIe physical deviceunder a single root port to appear to be multiple separate physicaldevices to the virtualization software or the guest operating system.SR-IOV uses physical functions (PFs) and virtual functions (VFs) tomanage global functions for the SR-IOV devices.

PFs are full PCIe functions that include the SR-IOV extended capability,which is used to configure and manage the SR-IOV functionality. It ispossible to configure or control PCIe devices using PFs, and the PF hasfull ability to move data in and out of the device. VFs are lightweightPCIe functions that contain all the resources necessary for datamovement but have a minimized set of configuration resources. SR-IOVenabled PCIe devices present multiple instances of themselves to provideflow bifurcation, which is a mechanism used to split packet trafficbetween the user space and the kernel space.

The NIC 1050 is a hardware (or physical NIC, PNIC). As shown, the NICincludes a virtual bridge 1070, which acts as an MFE (or logicalswitch). The SR-IOV provides a PF 1030 and one or more VFs 1040. The PF1030 binds to the datapath daemon 225 in the user space 110. The VF 1040binds to a kernel VF driver 1005 in the kernel space 115.

The in-band management interface is provided by programing filter tables1060 on the NIC such that management interface traffic (for applications405-420) is sent to the VF 1040 and the non-management traffic (e.g.,the tenant packet traffic) is sent to PF 1030. The filter in someembodiments is based on VLAN and MAC address in order to bifurcatepacket traffic between the PF 1030 and the VF 1040. The VF binds tokernel and the PF binds o the datapath daemon 225.

In an SR-IOV implementation, the PF 1030 controls majority of theresources and configuration for the VFs. Therefore, in some embodimentsa configuration daemon 1010 is provided to pass the VF configuration toPF to let PF program hardware registers on behalf of VF. As shown, theconfiguration daemon 1010 retrieves the VF configuration from thedatapath daemon 225 and passes the information to the PF 1030, allowingthe PF 1030 to configure the VF 1040.

Since, the SR-IOV is a hardware-assisted feature this approach providesline rate processing capability. Unlike the user-kernel transport driver(or KNI) described above, in the SR-IOV approach is just required toenable device configuration and there is no need to take care of thepacket movement during the traffic split. The SR-IOV approach can,therefore, yield better performance with less processor overhead.

FIG. 11 conceptually illustrates a process 1100 for using flowbifurcation to configure a datapath pipeline to allow the use of thesame NIC for the datapath daemon and the user space applications thatrequire the user of the kernel network stack. The process in someembodiments is performed by the gateway 1000 in FIG. 10.

As shown, the process configures (at 1105) a SR-IOV interface with aphysical function (PF) and a virtual function (VF). For instance, theprocess configures the virtual bridge 1070, the PF 1030, and the VF 1040in FIG. 10.

The process then binds (at 1110) the PF to the datapath daemon in theuser space. For instance, the process binds the PF 1030 to the datapathdaemon 225 in FIG. 10. The process also binds (at 1115) the VF to thekernel space. For instance, the process binds the VF 1040 to a kernel VFdriver 1005 in FIG. 10. The process then ends.

FIG. 12 conceptually illustrates a process 1200 for processing packetsby the pipeline of FIG. 10 in some embodiments. The process in someembodiments is performed by the gateway 1000 in FIG. 10. As shown, theprocess communicates (at 1205) tenant packet traffic between the PF andthe datapath daemon through the pipeline in the user space. Forinstance, the process exchanges packet traffic for the datacenter tenantapplications through the PF 1030 to the datapath daemon 225 through thepipeline in the user space 110 (the pipeline conceptually shown betweenthe I/O buffers 215, DPDK 220, and datapath daemon 225.

The process also communicates (at 1210) user space traffic forapplications such as management interface packet traffic that requirethe use of the network packet stack through the pipeline of the VF,kernel VF driver, and kernel network stack. For instance, the processsends and receives packets for management interface applications 405-420through the pipeline of VF 1040, kernel VF driver 1005, and kernelnetwork stack 425. The process then proceeds back to 1205.

FIG. 13 conceptually illustrates a process 1300 for restoring themanagement interface network connectivity when the datapath daemon ofFIG. 10 fails in some embodiments. The process is performed eithermanually or automatically by a monitoring script that monitors thestatus of the datapath daemon in some embodiments.

As shown, the process configures (at 1305) the datapath daemon in theuser space and the VF and PF in the NIC. For instance, the processconfigures datapath daemon 225 as described above by reference to FIGS.10-11. The process then uses (at 1310) the datapath daemon (as describedabove) to send and receive packets for tenant user space applicationsthrough the PF and the management interface applications that requireaccess to the network stack through the VF.

The process then determines (at 1315) whether the datapath daemon hasfailed. For instance, the process determines whether the datapath daemon225 in FIG. 10 has crashed. If not, the process proceeds to 1305 tocontinue using the datapath daemon for both tenant user spaceapplications and the management interface user space applications.

Otherwise, the process re-assigns (at 1320) the NICs to the kernel. Forinstance, the process bonds the NIC 150 (or multiple NICs in a linkaggregation group) to a NIC driver (such as driver 125 in FIG. 1) in thekernel space. The process then restores (at 1325) the managementinterface connectivity through the kernel. For instance, the processconnects management interface applications 405-420 to a kernel pipelinesuch as the pipeline shown in FIG. 1. The process then removes (at 1330)the PF and the VF that were configured for the management interface. Forinstance, the process removes the PF 1030 and the VF 1040 in FIG. 10.The process then ends.

III. Electronic System

Many of the above-described features and applications are implemented assoftware processes that are specified as a set of instructions recordedon a computer readable storage medium (also referred to as computerreadable medium). When these instructions are executed by one or moreprocessing unit(s) (e.g., one or more processors, cores of processors,or other processing units), they cause the processing unit(s) to performthe actions indicated in the instructions. Examples of computer readablemedia include, but are not limited to, CD-ROMs, flash drives, RAM chips,hard drives, EPROMs, etc. The computer readable media does not includecarrier waves and electronic signals passing wirelessly or over wiredconnections.

In this specification, the term “software” is meant to include firmwareresiding in read-only memory or applications stored in magnetic storage,which can be read into memory for processing by a processor. Also, insome embodiments, multiple software inventions can be implemented assub-parts of a larger program while remaining distinct softwareinventions. In some embodiments, multiple software inventions can alsobe implemented as separate programs. Finally, any combination ofseparate programs that together implement a software invention describedhere is within the scope of the invention. In some embodiments, thesoftware programs, when installed to operate on one or more electronicsystems, define one or more specific machine implementations thatexecute and perform the operations of the software programs.

FIG. 14 conceptually illustrates an electronic system 1400 with whichsome embodiments of the invention are implemented. The electronic system1400 can be used to execute any of the control, virtualization, oroperating system applications described above. The electronic system1400 may be a computer (e.g., desktop computer, personal computer,tablet computer, server computer, mainframe, blade computer etc.),phone, PDA, or any other sort of electronic device. Such an electronicsystem includes various types of computer readable media and interfacesfor various other types of computer readable media. Electronic system1400 includes a bus 1405, processing unit(s) 1410, a system memory 1420,a read-only memory (ROM) 1430, a permanent storage device 1435, inputdevices 1440, and output devices 1445.

The bus 1405 collectively represents all system, peripheral, and chipsetbuses that communicatively connect the numerous internal devices of theelectronic system 1400. For instance, the bus 1405 communicativelyconnects the processing unit(s) 1410 with the read-only memory 1430, thesystem memory 1420, and the permanent storage device 1435.

From these various memory units, the processing unit(s) 1410 retrieveinstructions to execute and data to process in order to execute theprocesses of the invention. The processing unit(s) may be a singleprocessor or a multi-core processor in different embodiments.

The read-only-memory 1430 stores static data and instructions that areneeded by the processing unit(s) 1410 and other modules of theelectronic system. The permanent storage device 1435, on the other hand,is a read-and-write memory device. This device is a non-volatile memoryunit that stores instructions and data even when the electronic system1400 is off. Some embodiments of the invention use a mass-storage device(such as a magnetic or optical disk and its corresponding disk drive) asthe permanent storage device 1435.

Other embodiments use a removable storage device (such as a floppy disk,flash drive, etc.) as the permanent storage device. Like the permanentstorage device 1435, the system memory 1420 is a read-and-write memorydevice. However, unlike storage device 1435, the system memory is avolatile read-and-write memory, such as random access memory. The systemmemory stores some of the instructions and data that the processor needsat runtime. In some embodiments, the invention's processes are stored inthe system memory 1420, the permanent storage device 1435, and/or theread-only memory 1430. From these various memory units, the processingunit(s) 1410 retrieve instructions to execute and data to process inorder to execute the processes of some embodiments.

The bus 1405 also connects to the input and output devices 1440 and1445. The input devices enable the user to communicate information andselect commands to the electronic system. The input devices 1440 includealphanumeric keyboards and pointing devices (also called “cursor controldevices”). The output devices 1445 display images generated by theelectronic system. The output devices include printers and displaydevices, such as cathode ray tubes (CRT) or liquid crystal displays(LCD). Some embodiments include devices, such as a touchscreen, thatfunction as both input and output devices.

Finally, as shown in FIG. 14, bus 1405 also couples electronic system1400 to a network 1425 through a network adapter (not shown). In thismanner, the computer can be a part of a network of computers (such as alocal area network (“LAN”), a wide area network (“WAN”), an Intranet, ora network of networks, such as the Internet. Any or all components ofelectronic system 1400 may be used in conjunction with the invention.

Some embodiments include electronic components, such as microprocessors,storage, and memory, that store computer program instructions in amachine-readable or computer-readable medium (alternatively referred toas computer-readable storage media, machine-readable media, ormachine-readable storage media). Some examples of such computer-readablemedia include RAM, ROM, read-only compact discs (CD-ROM), recordablecompact discs (CD-R), rewritable compact discs (CD-RW), read-onlydigital versatile discs (e.g., DVD-ROM, dual-layer DVD-ROM), a varietyof recordable/rewritable DVDs (e.g., DVD-RAM, DVD-RW, DVD+RW, etc.),flash memory (e.g., SD cards, mini-SD cards, micro-SD cards, etc.),magnetic and/or solid state hard drives, read-only and recordableBlu-Ray® discs, ultra density optical discs, any other optical ormagnetic media, and floppy disks. The computer-readable media may storea computer program that is executable by at least one processing unitand includes sets of instructions for performing various operations.Examples of computer programs or computer code include machine code,such as is produced by a compiler, and files including higher-level codethat are executed by a computer, an electronic component, or amicroprocessor using an interpreter.

While the above discussion primarily refers to microprocessor ormulti-core processors that execute software, some embodiments areperformed by one or more integrated circuits, such as applicationspecific integrated circuits (ASICs) or field programmable gate arrays(FPGAs). In some embodiments, such integrated circuits executeinstructions that are stored on the circuit itself.

As used in this specification, the terms “computer”, “server”,“processor”, and “memory” all refer to electronic or other technologicaldevices. These terms exclude people or groups of people. For thepurposes of the specification, the terms display or displaying meansdisplaying on an electronic device. As used in this specification, theterms “computer readable medium,” “computer readable media,” and“machine readable medium” are entirely restricted to tangible, physicalobjects that store information in a form that is readable by a computer.These terms exclude any wireless signals, wired download signals, andany other ephemeral or transitory signals.

While the invention has been described with reference to numerousspecific details, one of ordinary skill in the art will recognize thatthe invention can be embodied in other specific forms without departingfrom the spirit of the invention. In addition, a number of the figures(including FIGS. 5-7, 9, and 11-13) conceptually illustrate processes.The specific operations of these processes may not be performed in theexact order shown and described. The specific operations may not beperformed in one continuous series of operations, and different specificoperations may be performed in different embodiments. Furthermore, theprocess could be implemented using several sub-processes, or as part ofa larger macro process.

This specification refers throughout to computational and networkenvironments that include virtual machines (VMs). However, virtualmachines are merely one example of data compute nodes (DCNs) or datacompute end nodes, also referred to as addressable nodes. DCNs mayinclude non-virtualized physical hosts, virtual machines, containersthat run on top of a host operating system without the need for ahypervisor or separate operating system, and hypervisor kernel networkinterface modules.

VMs, in some embodiments, operate with their own guest operating systemson a host using resources of the host virtualized by virtualizationsoftware (e.g., a hypervisor, virtual machine monitor, etc.). The tenant(i.e., the owner of the VM) can choose which applications to operate ontop of the guest operating system. Some containers, on the other hand,are constructs that run on top of a host operating system without theneed for a hypervisor or separate guest operating system. In someembodiments, the host operating system uses name spaces to isolate thecontainers from each other and therefore provides operating-system levelsegregation of the different groups of applications that operate withindifferent containers. This segregation is akin to the VM segregationthat is offered in hypervisor-virtualized environments that virtualizesystem hardware, and thus can be viewed as a form of virtualization thatisolates different groups of applications that operate in differentcontainers. Such containers are more lightweight than VMs.

Hypervisor kernel network interface module, in some embodiments, is anon-VM DCN that includes a network stack with a hypervisor kernelnetwork interface and receive/transmit threads. One example of ahypervisor kernel network interface module is the vmknic module that ispart of the ESXi™ hypervisor of VMware, Inc.

One of ordinary skill in the art will recognize that while thespecification refers to VMs, the examples given could be any type ofDCNs, including physical hosts, VMs, non-VM containers, and hypervisorkernel network interface modules. In fact, the example networks couldinclude combinations of different types of DCNs in some embodiments.

In view of the foregoing, one of ordinary skill in the art wouldunderstand that the invention is not to be limited by the foregoingillustrative details, but rather is to be defined by the appendedclaims.

1. A method of utilizing a same hardware network interface card (NIC) ina gateway of a datacenter to communicate datacenter tenant packettraffic and packet traffic for a set of applications executing in a userspace of the gateway that utilize a network stack in a kernel space ofthe gateway, the method comprising: sending and receiving packets forthe datacenter tenant packet traffic through a packet datapath in a userspace of the gateway; sending incoming packets from the NIC to the setof applications through the datapath in the user space, a user-kerneltransport driver connecting the kernel network stack to the datapath inthe user space, and the kernel network stack; and receiving outgoingpackets at the NIC from the set of applications through the kernelnetwork stack, the user-kernel transport driver, and the data path inthe user space.
 2. The method of claim 1, wherein the user-kerneltransport driver is a kernel NIC interface (KNI) configured in thekernel space of the gateway to communicate packets between the userspace and the kernel space of the gateway.
 3. The method of claim 1,wherein the datapath in the user space comprises a datapath daemonproviding routing and switching services for the tenant packet traffic.4. (canceled)
 5. The method of claim 1, wherein the tenant packettraffic goes through the user space of the gateway without entering thekernel space of the gateway.
 6. The method of claim 1, wherein thetenant packet traffic is communicated between the gateway and a set oftenant applications residing on a set of datacenter hosts external tothe gateway.
 7. The method of claim 1, wherein the set of applicationsin the user space of the gateway that utilize the network stack areapplications for a management interface utilized for monitoring a stateof data compute nodes (DCNs) and a set of datacenter hosts on which theDCNs are execute, controlling the DCNs on each host, connecting anadministrator console to a DCN for managing the DCN, and viewing usageinformation about each DCN.
 8. The method of claim 7, wherein the set ofapplications comprises one or more of a user space secure shell (ssh), adynamic host configuration protocol (DHCP) client, a user spacemanagement plane agent communicating with a management plane of thegateway, and a control plane agent communicating with a control plane ofthe gateway.
 9. The method of claim 1, wherein the network stack is atransport control protocol/Internet protocol (TCP/IP) stack.
 10. Themethod of claim 1, wherein the datapath comprises a managed forwardingelement connected to a virtual local area network (VLAN) assigned to theset of applications, wherein sending incoming packets from the NIC tothe set of applications through the datapath in the user space comprisessending the packets to the VLAN through the managed forwarding element.11. A network gateway for utilizing a same hardware network interfacecard (NIC) to communicate tenant packet traffic of a datacenter andpacket traffic for a set of applications in a user space of the gatewaythat utilize a network stack in a kernel space of the gateway, thegateway comprising: a hardware network interface card (NIC); a memoryconfigured into said user and kernel spaces, the kernel space forexecuting the network stack and a user-kernel transport driverconnecting the kernel network stack to a packet datapath in the userspace, the user space for executing the set of applications that utilizethe network stack in the kernel space; the NIC for: sending andreceiving packets for the datacenter tenant packet traffic through thepacket datapath in the user space of the gateway; sending incomingpackets to the set of applications through the data path in the userspace, the user-kernel transport driver, and the kernel network stack;and receiving outgoing packets from the set of applications through thekernel network stack, the user-kernel transport driver, and the datapath in the user space.
 12. The gateway of claim 11, wherein theuser-kernel transport driver is a kernel NIC interface (KNI) configuredin the kernel space of the gateway to communicate packets between theuser space and the kernel space of the gateway.
 13. The gateway of claim11, wherein the datapath in the user space comprises a datapath daemonproviding routing and switching services for the tenant packet traffic.14. (canceled)
 15. The gateway of claim 11, wherein the tenant packettraffic goes through the user space of the gateway without entering thekernel space of the gateway.
 16. The gateway of claim 11, wherein thetenant packet traffic is communicated between the gateway and a set oftenant applications residing on a set of datacenter hosts external tothe gateway.
 17. The gateway of claim 11, wherein the set ofapplications in the user space that utilize the network stack areapplications for a management interface utilized for monitoring a stateof data compute nodes (DCNs) and a set of datacenter hosts on which theDCNs are execute, controlling the DCNs on each host, connecting anadministrator console to a DCN for managing the DCN, and viewing usageinformation about each DCN.
 18. The gateway of claim 17, wherein the setof applications comprises one or more of a user space secure shell(ssh), a dynamic host configuration protocol (DHCP) client, a user spacemanagement plane agent communicating with a management plane of thegateway, and a control plane agent communicating with a control plane ofthe gateway.
 19. The gateway of claim 11, wherein the network stack is atransport control protocol/Internet protocol (TCP/IP) stack.
 20. Thegateway of claim 11, wherein the datapath comprises a managed forwardingelement connected to a virtual local area network (VLAN) assigned to theset of applications, wherein sending incoming packets from the NIC tothe set of applications through the datapath in the user space comprisessending the packets to the VLAN through the managed forwarding element.